package org.jsbd.boss.dao.impl;

import java.util.HashMap;
import java.util.Map;

import org.jsbd.boss.dao.ISystemDAO;
import org.jsbd.boss.domian.channel.DaemonApkConfig;
import org.jsbd.boss.domian.channel.OS;
import org.springframework.stereotype.Repository;

@Repository("systemDao")
public class SystemDAOImpl extends CrackBaseDao implements ISystemDAO {

	@Override
	public Map<String, Object> selectSystemByPage(OS os) {
		os = (os == null ? new OS() : os);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("rows", super.queryForList("qy_system.SELECT_SYSTEM_BY_PAGE_LIST", os));
		map.put("total", super.queryForCount("qy_system.SELECT_SYSTEM_BY_PAGE_COUNT", os));
		return map;
	}

	@Override
	public void insertSystem(OS os) {
		super.insert("qy_system.INSERT_SYSTEM", os);
	}

	@Override
	public void updateSystem(OS os) {
		super.update("qy_system.UPDATE_SYSTEM", os);
	}

	@Override
	public OS getByVersion(String version) {
		return (OS) super.queryForObject("qy_system.SELECT_BY_VERSION", version);
	}

	@Override
	public void phoneTypeEdit(OS os) {
		super.update("qy_system.UPDATE_PHONE_TYPE_EDIT", os);
	}

}
